<?php
namespace V1\Logic;


class MessageLogic  {
    /**
     * 用户完成订单
     * @param type $uid 用户ID
     * @param type $stockname 股票名称
     * @param type $selected_game_type 游戏类型
     * @param type $money 下注金额
     * @param type $balance_date 开奖时间
     */
    public static function finishedOrder($uid,$stockname,$selected_game_type,$money,$balance_date){
        
        $game_types = ['gul'=>'猜涨跌','extremun'=>'涨跌幅'];
        $remark ="你参与了[color=red]{$stockname}[/color]{$game_types[$selected_game_type]}，下注金额为￥{$money}，{$balance_date}开奖，请及时关注。";
        
        $data=['user_id'=>$uid,'remark'=>$remark,'redirect'=>'','status'=>1,'type'=>0,'update_time'=>NOW_TIME];
        
        M('CommonMessage')->add($data);
    }
}